package com.quan.amqp.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.quan.common.base.constant.CommonConstant;
import com.quan.sport.feign.UpmsLogService;
import com.quan.upms.entity.UpmsLog;

/**
 * RabbitMQ 主题模式
 * @author yhaoquan
 *
 */
@Component
@RabbitListener(queues = CommonConstant.MQ_TOPIC_MESSAGE_DEFAULT)
public class TopicMessageLogListener {
	
	private Logger logger = LoggerFactory.getLogger(getClass()) ;
	
	@Autowired
	private UpmsLogService userService ;
	
	@RabbitHandler
	public void processMessage(UpmsLog log) {
		logger.info("处理队列消息==>>记录日志>>>>>>>>");
		this.userService.add(log) ;
	}

}
